﻿var strModuleName = "User";
var nCurrentUserOrganizationId = 1;
var bIsEditMode = false;
var strEventForCallBack = "";



//******  Region Contants  ******//
var NOPERMISSION = "You don't have enough permissions to perform this operation.";
var SESSIONMESSAGE = "Session expired.";
var SESSIONSUCCESS = "true";
var ValidationFail = "Validation fail";
var NoSession = "No Session Exist.";

//-------Web Grid Constants-----//
var DEFAULTSELECTEDRECORD = -1;
var DEFAULTORGID = 1;
var DEFAULTPAGE = 1;
var DEFAULTSORTON = "";
var DEFAULTSORTTYPE = "";
var DEFAULTSEARCH = "";
var DEFAULTSEARCHON = "";
var DEFAULTTABINDEX = 0;
var DEFAULTPAGESIZE = 0;
//------------------------------//

//*****  End Region    ********//


//*******Web Grid Globals**************//
var nGbOrgId = DEFAULTORGID;
var strGbSortOn = DEFAULTSORTON;
var strGbSortType = DEFAULTSORTTYPE;
var nGbCurrentlySelectedRecord = DEFAULTSELECTEDRECORD;
var nGbLastSelectedRecord = DEFAULTSELECTEDRECORD;
var nGbCurrentPage = DEFAULTPAGE;
var nGbTotalPages = -1;
var nGBTabIndex = DEFAULTTABINDEX;
var nGBPageSize = DEFAULTPAGESIZE;
var nGBSearch = DEFAULTSEARCH;
var nGBSearchOn = DEFAULTSEARCHON;
//**************************************//

$(document).ready(function () {

    jQuery.ajaxSetup({ async: false, cache: false });
    //**this function is called when ajax request is start processing.**//
    //** in this function we set async behaviour of jquery to false means sync its execution and show loading div on ui.
    jQuery(document).ajaxStart(function () {
        jQuery.ajaxSetup({ async: false, cache: false });
        //show loading div
        $("#gb-loading-section").show();
        $('#ajax-loader-hider-id').show();
        $('#ajax-loader-id').show();

    })
    //**this function is called when ajax request is stop processing.**//
    //** in this function we hide loading div on ui.
    jQuery(document).ajaxStop(function () {
        //hide loading div
        $("#gb-loading-section").hide();
        $('#ajax-loader-hider-id').hide();
        $('#ajax-loader-id').hide();
    })

    /*this function created resizable columns in grid*/
    jQuery(document).ajaxComplete(function () {
        $("#tbl-gd-main").colResizable( { disable: true } );
        $("#tbl-gd-main").colResizable({ disable: false, liveDrag: true });
    });
});
